#!/bin/sh
usage()
{
    echo "Usage: $0 -o outputfile -l logfile "
}
while getopts o:l:t: o; do
    case "$o" in
    o)
        outfile="$OPTARG"
        ;;
    l)
        logfile="$OPTARG"
        ;;
    [?])
        usage
        exit 1
        ;;
    esac
done

if [ "X$outfile" = "X" ]; then
    usage
    exit 1
fi
if [ "X$logfile" = "X" ]; then
    usage
    exit 1
fi

tail -F -n +0 $logfile 2>/dev/null |python2.7 analysis.py $outfile


